package com.kalua.list.domainmodel;


public class NumericId extends BaseIdentifier implements Comparable<NumericId>{

	private static final long serialVersionUID = 689165347778421579L;
	
	private Long value;
		
	private NumericId() { }
	
	public NumericId(Long value) {
		this();
		setValue(value);
	}
	
	public Long getValue() { return value; }	
	private void setValue(Long value) { this.value = value; }
	
	@Override
	public String toString() {	 return String.valueOf(getValue()); }

	@Override
	protected Object[] getConstituents() { return new Object[]{getValue()}; }

	@Override
	public int compareTo(NumericId other) {
		int result;		
		if (this.value < other.value)
			result = -1;
		else if (this.value > other.value)
			result = 1;
		else result = 0;		
		return result;
	}
}